package com.my.cd.mediator;

/**
 * 具体工作者：闹钟
 */
public class Alarm extends Worker {

    public Alarm(String name, Mediator mediator) {
        super(name, mediator);
        mediator.register(name, this);
    }

    public void sendAlarm(int stateChange) {
        sendMessage(stateChange);
    }

    @Override
    public void sendMessage(int stateChange) {
        this.getMediator().receiveMessage(this.name, stateChange);
    }

}
